package d1104.r21118.nw;


public class Test {
    public static void main(String[] args) {

    }
}
    class Animal {
        protected String name;

        public Animal() {
        }

        public Animal(String name) {
            this.name = name;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public void eat() {
            System.out.println("吃");
        }

        public void shout() {
            System.out.println("叫");
        }

        class Cat extends Animal {
            public Cat() {
            }

            public Cat(String name) {
                super(name);
            }

            public void catchMouse() {
                System.out.println("抓老鼠");
            }
        }

        class Dog extends Animal {
            public Dog() {
            }

            public Dog(String name) {
                super(name);
            }

            public void lookHouse() {
                System.out.println("看家");
            }
        }
    }
